<%@ page language="java" contentType="text/html; charset=UTF-8"   pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%String path = request.getContextPath() ;%>
<script type="text/javascript" src="<%=path%>/lib/jquery/js/jquery-1.3.2.min.js"></script>
<SCRIPT LANGUAGE="JavaScript">
if(top.mainframe){
	top.location.href = "<%=path%>/login.action";
}

$('#yanzhengma').attr('src','<%=path%>/systemService/checkCode.action?$r='+Math.random());
$('#reLoadImg').click(function(){
	$(this).prev().attr('src','<%=path%>/systemService/checkCode.action?$r='+Math.random());
});

$('INPUT').live("mouseover",function(){
	$(this).focus();
});

var info=null;
$('#userName').change(function(){
	$.ajax({
		type:"GET",
		cache:false,
		dataType:"json",
		async:false,
		url: "<%=path%>/json/checkLogin.action?userName="+this.value+"&$r="+Math.random(),
		success: function(data){
			info=null;
			if(data.msg!=null&&data.msg.length>0){
				var tmp = data.msg.split('|');
				if(tmp.length==3)
					info = '账号：'+tmp[0]+'于'+tmp[1]+'在'+tmp[2]+'登录，您是否需要强制登录？';
			}		
		}
	});
});

var checkForm = function(_form){
	if(info!=null&&!confirm(info))
		return false;
	else
		return true;
}

var msg = '<s:property value="msg"/>';
if(msg!=null&&msg.length>0){
	alert(msg);
}
</SCRIPT>